Next | Prev | Up | Top | Contents | Index

How Texture Objects Work

In OpenGL 1.0, only one texture can be associated with each of the texture targets GL_TEXTURE_1D and GL_TEXTURE_2D. If you want to render a scene that contains many 2D textures, you have to redefine the 2D texture using glTexImage2D() for each texture in the scene. If you want each texture to have different parameters, such as wrap modes and filters, you have to redefine those as well.

The texture object extension lets you create as many textures as you need. You associate a name (a positive number) with a texture object when you create it, and then you define the images and parameters of the texture. As you render your scene, bind the name of each desired texture object to the appropriate texture target. Since binding a texture takes less time than defining one, this is a more efficient way to switch from one texture to another.

Note: Texture objects and display lists are in different name spaces. However, if two contexts are sharing display lists, they also share texture objects.


Next | Prev | Up | Top | Contents | Index